<?php
/**
 * Created by PhpStorm.
 * Author: Shadow
 * Date: 2022/4/30
 * Time: 9:34 上午
 * description: api.php
 */

use think\facade\Route;
//allowCrossDomain()单个路由解决跨域问题
Route::post('login',"Login/login")->allowCrossDomain();
Route::get('getCaptcha',"Login/createCaptcha")->allowCrossDomain();
Route::get('logout','Login/logout');


Route::group(function (){
    /**
     * 商品有关接口
     */
    Route::resource('goods','goods');

    /**
     * 品牌相关
     */
    Route::resource('brand','brand');

    /**
     * 分类相关
     */
    Route::resource('category','category');

    /**
     * 类型/模型相关
     */
    Route::resource('type','type');

    /**
     * 权限有关接口
     */
    Route::resource('auth','auth');

    /**
     * 文件上传有关接口
     */

    Route::post("singleUpload","File/singleUpload");
    Route::post("multiUpload","File/multiUpload");
    Route::post("cloudStorage","File/cloudStorage");
    Route::post('deleteCloud',"File/deleteCloud");



})->middleware(\app\adminapi\middleware\Login::class)->allowCrossDomain();


/**
 * web攻击xss
 */
Route::get('xss','Safe/xss');



